home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / clipper / mrddem.zip / MRDDEMO.PRG < prev    next >
Text File  |  1994-06-30  |  6KB  |  174 lines

  1. #Include "Box.ch"
  2.  
  3. EXTERNAL BLIMGRSTS, SWPRUNCMD, BLIVERNUM
  4. EXTERNAL MethodName
  5.  
  6.  
  7. STATIC cStatic
  8.  
  9.  
  10.  
  11. /*
  12.  ┌─ Function ───────────────────────────────────────────────────────────────┐
  13.  │         Name: MAIN()                                                     │
  14.  │  Description: What's the fastest we can bang together a denmo program    │
  15.  │       Author: Darren Lancaster                                           │
  16.  │ Date created: 29-06-94              Date updated: ■29-06-94              │
  17.  │ Time created: 11:22:26am            Time updated: ■11:22:26am            │
  18.  │    Copyright: L&W Computer Services Ltd                                  │
  19.  ├──────────────────────────────────────────────────────────────────────────┤
  20.  │    Arguments: None                                                       │
  21.  │ Return Value: MAIN()                                                     │
  22.  │     See Also:                                                            │
  23.  └──────────────────────────────────────────────────────────────────────────┘
  24. */
  25.  
  26. MEMVAR cPublic, cPrivate
  27. FUNCTION MAIN()
  28.    LOCAL cLocal
  29.    LOCAL cScreen := SAVESCREEN(0,0, MAXROW(), MAXCOL())
  30.    PUBLIC cPublic
  31.    PRIVATE cPrivate
  32.  
  33.  
  34.    cPublic := "Alt-P toggle publics on or off"
  35.  
  36.    cStatic := "Alt-S will toggle statics on or off"
  37.  
  38.    cPrivate := "Alt-V will toggle Private variables on or off"
  39.  
  40.    cLocal := "Alt-L will toggle Local variable on or off"
  41.  
  42.    Screen()                                                                    // call a function
  43.  
  44.    Mainmenu()                                                                  // Play with an object
  45.  
  46.    RestScreen(0,0, MAXROW(), MAXCOL(), cScreen)
  47.  
  48. RETURN(NIL)
  49.  
  50.  
  51.  
  52.  
  53. /*┌─────────┬────────────────────────────────────────────────────────────────┐
  54.   │ Function│MainMenu() --> NIL                                              │
  55.   │  Purpose│Main Menu                                                       │
  56.   │Date-Time│29-06-94 12:06pm                                                │
  57.   │Copyright│L&W Computer Services Ltd.                                      │
  58.   │   Author│Ian Day                                                         │
  59.   └─────────┴────────────────────────────────────────────────────────────────┘*/
  60. STATIC FUNCTION MainMenu
  61.  
  62.    LOCAL oWindow, nChoice, lFinish := .F., cSetColor := SetColor("GR+/B,B/W,N,,W+/B"),;
  63.          oTitle
  64.  
  65.    LOCAL aMenu := {"Look at DBFs",;
  66.                    "Crash the Program",;
  67.                    "Show a Tbrowse",;
  68.                    "Disable an ALTD()",;
  69.                    "Quit"}
  70.    LOCAL aBlocks := { {|| BrowData() },;
  71.                      {|| Crash() },;
  72.                      {|| browser(6, 10, 21, 50) },;
  73.                      {|| DisAltd() },;
  74.                      {|| lFinish := .T. }}
  75.  
  76.    DispBegin()
  77.    oTitle := Title():New("Main Menu")
  78.    oWindow := Window():New(8, 30, 5, 20, "Main Menu"):Display()
  79.  
  80.    SetColor("W+/B,B/W,N,,W+/B")
  81.    @ oWindow:nTop + 3, oWindow:nLeft + 2 TO oWindow:nBottom - 1, oWindow:nLeft + 2
  82.  
  83.  
  84.    DispEnd()
  85.  
  86.    DO WHILE !lFinish
  87.       nChoice := aChoice(oWindow:nTop + 3, oWindow:nLeft + 3, oWindow:nBottom - 1, oWindow:nRight - 1, aMenu)
  88.  
  89.       IF nChoice > 0
  90.          Eval(aBlocks[nChoice])
  91.       ELSE
  92.          EXIT
  93.       ENDIF
  94.    ENDDO
  95.  
  96.    DispBegin()
  97.    oWindow:CLASS:CloseAll()
  98.    oTitle:Close()
  99.    SetColor(cSetColor)
  100.    DispEnd()
  101.  
  102. RETURN (NIL)
  103.  
  104.  
  105.  
  106. /*┌─────────┬────────────────────────────────────────────────────────────────┐
  107.   │ Function│SysTitle() --> <cSysTitle>                                      │
  108.   │  Purpose│Return system title                                             │
  109.   │Date-Time│29-06-94 11:38am                                                │
  110.   │Copyright│L&W Computer Services Ltd.                                      │
  111.   │   Author│Ian Day                                                         │
  112.   └─────────┴────────────────────────────────────────────────────────────────┘*/
  113. FUNCTION SysTitle
  114. RETURN ("MrDebug Demo Program")
  115.  
  116.  
  117.  
  118. /*┌─────────┬────────────────────────────────────────────────────────────────┐
  119.   │ Function│Screen() --> NIL                                                │
  120.   │  Purpose│Main screen                                                     │
  121.   │Date-Time│08-13-93      07:26:33pm                                        │
  122.   │Copyright│L&W Computer Services Ltd.                                      │
  123.   │   Author│Ian Day                                                         │
  124.   └─────────┴────────────────────────────────────────────────────────────────┘*/
  125. STATIC FUNCTION Screen
  126.  
  127.    DispBegin()
  128.    SetColor("B/BG")
  129.    @ 0, 0, 3, MaxCol() BOX B_SINGLE + " "
  130.    @ MaxRow(), 0 CLEAR TO MaxRow(), MaxCol()
  131.  
  132.    @ 1, 2 SAY Date()
  133.    @ 1, MaxCol() - 9 SAY Time()
  134.    @ 1, MaxCol() / 2 - Len(SysTitle()) / 2 SAY SysTitle()
  135.  
  136.    @ 4, 0, MaxRow() - 1, MaxCol() BOX Replicate("▒", 9)
  137.    DispEnd()
  138.  
  139.  
  140. RETURN (NIL)
  141.  
  142.  
  143.  
  144. /*
  145.  ┌─ Function ───────────────────────────────────────────────────────────────┐
  146.  │         Name: DisAltd()                                                  │
  147.  │  Description: I left an ALTD() in that loop - ARGHHHHHHH!                │
  148.  │       Author: Darren Lancaster                                           │
  149.  │ Date created: 30-06-94              Date updated: ■30-06-94              │
  150.  │ Time created: 00:10:50am            Time updated: ■00:10:50am            │
  151.  │    Copyright: L&W Computer Services Ltd                                  │
  152.  ├──────────────────────────────────────────────────────────────────────────┤
  153.  │    Arguments: None                                                       │
  154.  │ Return Value: FUNCTION DisAltd()                                         │
  155.  │     See Also:                                                            │
  156.  └──────────────────────────────────────────────────────────────────────────┘
  157. */
  158. STATIC FUNCTION DisAltd()
  159.    LOCAL nI := 0
  160.  
  161.    FOR nI := 1 TO 10
  162.       // How many time have you forgotten about an ALTD() function
  163.       // within your code
  164.       // MrDebug allows you to Disable and ALTD() function
  165.  
  166.       ALTD()     // move the cursor to this line in the source code
  167.                  // and press Shift-Alt-D. When you next run the
  168.                  // program you won't have to keep pressing
  169.                  // F5 until you are out of the loop.
  170.  
  171.    NEXT
  172.  
  173. RETURN(NIL)
  174.